package com.learn.springcloud.user.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.learn.dubbo.core.controller.BaseController;
import com.learn.dubbo.core.systemenum.TypeEnum;
import com.learn.dubbo.entity.user.SysUser;
import com.learn.springcloud.user.service.UserService;

@RestController
public class UserController extends BaseController{
	
	private static final Logger logger=LoggerFactory.getLogger(UserController.class);
	
	@Autowired
	private UserService userService;
	
	
	@RequestMapping("/getUserInfo")
	public SysUser getUserInfo(String param) {
		Long id = getParameter("id", param,TypeEnum.Long);
		SysUser user = userService.getUserInfo(id);
		return user;
	}
	
	@RequestMapping("/")
    public String home() {
		logger.debug("调整");
        return "index";
    }
	
	@RequestMapping("/user")
	public String user() {
        return "hello";
    }

}
